<?php
// Make output a real JavaScript file!
header('Content-type: text/javascript'); // browser will now recognize the file as a valid JS file

// prevent browser from caching
header('pragma: no-cache');
header('expires: 0'); // i.e. contents have already expired


$output = "var tinyMCEImageList = new Array(";
$newLine = "\n";


		foreach($maps as $file):
			$ext = end(explode('.', $file));
			switch($ext)
			{
			case 'jpg':
			case 'png':
			case 'gif':
				$output.=$newLine;
				$output.= '["'.$file.'", "'.base_url().'upload/mail/'.$file.'"],';
			break;
			}
		endforeach;


	 //Remove the last comma
	 $output = substr($output, 0, -1);
 
$output.=");";


	echo $output;

